﻿Public Class frmEmployees

    Private Sub btnadd_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnadd.Click
        Dim frm As New frmNewEmployee
        If frm.ShowDialog() = Windows.Forms.DialogResult.OK Then
            loademp()
        End If
    End Sub

    Public Sub New()

        ' This call is required by the designer.
        InitializeComponent()
        UI.FormatDataGrid(dgvlist)
        loademp()
        ' Add any initialization after the InitializeComponent() call.

    End Sub
    Private Sub loademp()
        dgvlist.DataSource = ClassEmployee.loadEmployee(txtsearch.Text)
    End Sub

    Private Sub txtsearch_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles txtsearch.TextChanged
        loademp()
    End Sub
End Class